package org.xmpp.packet;

import org.dom4j.Element;

public class Route extends Packet {

	public Route(Element element) {
		super(element);
	}
	
	@Override
	public Packet createCopy() {
		return new Route(this);
	}

	/**
	 * Based on Message.Message(Message)
	 * @param route
	 */
	private Route(Route route) {
		Element elementCopy = route.element.createCopy();
        docFactory.createDocument().add(elementCopy);
        this.element = elementCopy;
        // Copy cached JIDs (for performance reasons)
        this.toJID = route.toJID;
        this.fromJID = route.fromJID;
	}

}
